package router

import (
	"gin_hello/app/home"
	"github.com/gin-gonic/gin"
	"net/http"
)

func InitRouter() {
	gin.SetMode("debug")
	r := gin.New()

	r.GET("/", func(c *gin.Context) {
		c.String(http.StatusOK, "ok")
	})
	r.GET("/home", home.Index)

	// 连接db获取数据
	r.GET("/get", home.GetData)

	_ = r.Run(":3000")
}
